{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-share.tpl"}</nav>
    <article class="right-col">
    	<h2><a href="{$smarty.const.HOST_BACKEND}event/index">Danh sách sự kiện</a> &raquo; Thêm mới</h2>
        <form name="frmAdd" id="frmAdd" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}event/save" class="ui">
        	<input type="hidden" name="pcontent" id="pcontent" value="" />
            <input type="hidden" name="pcontact" id="pcontact" value="" />
            <input type="hidden" name="ptbfeature" id="ptbfeature" value="" />
            <input type="hidden" name="pfulladdr" id="pfulladdr" value="" />
        	<ul>
                {if isset($smarty.session.EVENT_ERROR)}
                    <li class="error">
                       {include file="common/error.tpl" dataSession=$smarty.session.EVENT_ERROR}    
                    </li>
                {/if}
                {if $arrAlbum}
                    <li>
                        <label for="palbumid">Album sideshow:</label>
                        <div class="sel">
                            <select id="palbumid" name="palbumid">
                                <option value="0">--Chọn--</option>
                                {foreach item=item from=$arrAlbum}
                                    <option value="{$item.albumid}" {if isset($smarty.session.EVENT_POST.palbumid) && $smarty.session.EVENT_POST.palbumid==$item.albumid}selected="selected"{/if}>{$item.name} ({$item.timage} hình)</option>
                                {/foreach}
                            </select>
                        </div>
                    </li>
                {/if}
                <li>
                    <label for="pcategoryid">Danh mục <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pcategoryid" name="pcategoryid">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrCategory}
                            	<option value="{$item.categoryid}" {if isset($smarty.session.EVENT_POST.pcategoryid) && $smarty.session.EVENT_POST.pcategoryid == $item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </li>                          
                <li>
                    <label for="pname">Tên sự kiện <span class="required">*</span>:</label>
                    <div class="txt">
                        <input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.EVENT_POST.pname)}{$smarty.session.EVENT_POST.pname|escape}{/if}" maxlength="{$smarty.const.VL_NAME_MAXLENGTH}" />
                    </div>
                </li>
                <li>
                    <label for="platitude">Vĩ độ:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="platitude" name="platitude" value="{if isset($smarty.session.EVENT_POST.platitude)}{$smarty.session.EVENT_POST.platitude|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="plongitude">Kinh độ:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="plongitude" name="plongitude" value="{if isset($smarty.session.EVENT_POST.plongitude)}{$smarty.session.EVENT_POST.plongitude|escape}{/if}"/>
                    </div>
                </li>
                
                <li>
                    <label for="pprovince">Tỉnh/thành <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pprovince" name="pprovince" onchange="javascript:loadDistrict(this.value,'pdistrict');">
                            <option value="0">---Chọn--</option>
                            {html_options options=$arrProvince selected=$smarty.session.EVENT_POST.pprovince}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="pdistrict">Quận/huyện <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pdistrict" name="pdistrict">
                            <option value="0">---Chọn--</option>
                            {if isset($smarty.session.EVENT_POST.pdistrict)}
                                {html_options options=$arrDistrict selected=$smarty.session.EVENT_POST.pdistrict}
                            {/if}
                        </select>
                    </div>
                </li> 
                <li>
                    <label for="paddr">Địa chỉ <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="paddr" id="paddr" value="{if isset($smarty.session.EVENT_POST.paddr)}{$smarty.session.EVENT_POST.paddr|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="pdstart">Ngày diễn ra <span class="required">*</span>:</label>
                    <div class="date">
                        <input type="text" class="text" name="pdstart" id="pdstart" value="{if isset($smarty.session.EVENT_POST.pdstart)}{$smarty.session.EVENT_POST.pdstart|escape}{/if}" readonly="readonly"/>
                        <input type="text" name="pdstart_hour" id="pdstart_hour" value="{$smarty.session.EVENT_POST.pdstart_hour}" class="half" placeholder="Giờ: 00-23" maxlength="2" />
                        <input type="text" name="pdstart_minute" id="pdstart_minute" value="{$smarty.session.EVENT_POST.pdstart_minute}" class="half" placeholder="Phút: 00-59" maxlength="2" />                        
                    </div>
                </li>
                <li>
                    <label for="pdend">Ngày kết thúc <span class="required">*</span>:</label>
                    <div class="date">
                        <input type="text" class="text" name="pdend" id="pdend" value="{if isset($smarty.session.EVENT_POST.pdend)}{$smarty.session.EVENT_POST.pdend|escape}{/if}" readonly="readonly"/>
                        <input type="text" name="pdend_hour" id="pdend_hour" value="{$smarty.session.EVENT_POST.pdend_hour}" class="half" placeholder="Giờ: 00-23" maxlength="2" />
                        <input type="text" name="pdend_minute" id="pdend_minute" value="{$smarty.session.EVENT_POST.pdend_minute}" class="half" placeholder="Phút: 00-59" maxlength="2" />
                    </div>                      
                </li>
                <li>
                    <label for="pprice">Giá (0:miễn phí):</label>
                    <div class="txt">
                        <input type="text" class="text" style="width:120px;" name="pprice" id="pprice" value="{if isset($smarty.session.EVENT_POST.pprice)}{$smarty.session.EVENT_POST.pprice|escape}{else}0{/if}" maxlength="3" onkeypress="javascript: return isNumberKey(event);"/> 
                    </div>
                </li>
                <li>
                    <label for="pqty">Số lượng tham gia:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pqty" id="pqty" value="{if isset($smarty.session.EVENT_POST.pqty)}{$smarty.session.EVENT_POST.pqty|escape}{else}0{/if}" maxlength="3" onkeypress="javascript: return isNumberKey(event);"/> 
                    </div>
                </li>                            
                <li>
                    <label for="pqtyreg">Giới hạn số lượng đăng ký:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pqtyreg" id="pqtyreg" value="{if isset($smarty.session.EVENT_POST.pqtyreg)}{$smarty.session.EVENT_POST.pqtyreg|escape}{else}0{/if}" maxlength="6" onkeypress="javascript: return isNumberKey(event);"/> 
                    </div>
                </li>
                <li>
                    <label for="pafrom">Độ tuổi:</label>
                    <div class="age">
                        <input type="text" name="pafrom" id="pafrom" value="{if isset($smarty.session.EVENT_POST.pafrom)}{$smarty.session.EVENT_POST.pafrom|escape}{/if}" maxlength="3" onkeypress="javascript: return isNumberKey(event);" class="half first"/>
                        <label>-</label>
                        <input type="text" name="pato" id="pato" value="{if isset($smarty.session.EVENT_POST.pato)}{$smarty.session.EVENT_POST.pato|escape}{/if}" maxlength="3" onkeypress="javascript: return isNumberKey(event);" class="half"/>
                    </div>                    
                </li>
                <li>
                    <label for="pimage">Hình đại diện <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="file" class="text" name="pimage" id="pimage" value="" />
                    </div>
                </li>
                <li>
                    <label for="pshort">Tóm lược:</label>
                    <div class="area">
                    	<textarea rows="1" cols="1" name="pshort" id="pshort">{if isset($smarty.session.EVENT_POST.pshort)}{$smarty.session.EVENT_POST.pshort}{/if}</textarea>
                    </div>
                </li>                           
                <li>
                    <label for="pcontent">Nội dung <span class="required">*</span>:</label>                    
                    <div class="area">
                    	<textarea id="fckcontent" name="fckcontent" rows="1" cols="1">{if isset($smarty.session.EVENT_POST.pcontent)}{$smarty.session.EVENT_POST.pcontent}{/if}</textarea>
                    </div>
                </li>
                <li>
                    <label for="pcontact">Liên hệ:</label>
                    <div class="area">
                    	<textarea id="fckcontact" name="fckcontact" rows="1" cols="1">{if isset($smarty.session.EVENT_POST.pcontact)}{$smarty.session.EVENT_POST.pcontact}{/if}</textarea>
                    </div>                               
                </li>
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptag" id="ptag" value="{if isset($smarty.session.EVENT_POST.ptag)}{$smarty.session.EVENT_POST.ptag|escape}{/if}" maxlength="{$smarty.const.VL_TAG_MAXLENGTH}" />
                    </div>
                </li>  
                <li>
                    <label for="padv">Hiển thị trang chủ:</label>
                    <div class="sel">
                        <select id="padv" name="padv">
                            {html_options options=$$arrSmarty.adv selected=$smarty.session.EVENT_POST.padv}
                        </select>
                    </div>
                </li> 
                <li>
                	<label>Thông tin mở rộng:</label>
                    {include file="common/table-feature.tpl"}
                </li>                                             
                <li>
                    <button type="submit">Lưu dữ liệu</button>
                    <button type="reset">Nhập lại</button>
                </li>
        	</ul>
        </form>
    </article>
</section>               	
{include file="common/footer.tpl"}
                
